/* 全局样式 */
body {
    background-color: #f8f9fa;
    padding-top: 60px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* 导航栏样式 */
.navbar {
    padding: 0.5rem 1rem;
}

.navbar-brand {
    font-size: 1.5rem;
    font-weight: bold;
    color: #fd7e14 !important;
}

.nav-link {
    font-size: 1rem;
    padding: 0.5rem 1rem !important;
}

.avatar-img {
    width: 32px;
    height: 32px;
    object-fit: cover;
    margin-right: 0.5rem;
}

/* 轮播图样式 */
.carousel {
    margin-top: -16px;
}

.carousel-img-container {
    height: 500px;
    position: relative;
}

.carousel-img-container img {
    height: 100%;
    object-fit: cover;
}

.carousel-caption {
    background: linear-gradient(to top, rgba(0,0,0,0.7), transparent);
    bottom: 0;
    left: 0;
    right: 0;
    padding: 2rem;
    text-align: left;
}

.carousel-caption h3 {
    font-size: 2rem;
    margin-bottom: 1rem;
}

/* 文章卡片样式 */
.post-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: none;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.post-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.15);
}

.post-img-container {
    height: 200px;
    overflow: hidden;
}

.post-img-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.post-card:hover .post-img-container img {
    transform: scale(1.1);
}

.card-title {
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
    font-weight: 600;
}

.card-text {
    color: #6c757d;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    height: 4.5rem;
}

.post-stats {
    color: #6c757d;
    font-size: 0.9rem;
}

/* 按钮样式 */
.btn-primary {
    background-color: #fd7e14;
    border-color: #fd7e14;
}

.btn-primary:hover {
    background-color: #e76b00;
    border-color: #e76b00;
}

.btn-outline-primary {
    color: #fd7e14;
    border-color: #fd7e14;
}

.btn-outline-primary:hover {
    background-color: #fd7e14;
    border-color: #fd7e14;
}

/* 页脚样式 */
.footer {
    border-top: 1px solid #dee2e6;
}

.layui-container {
    padding: 15px;
}

.layui-logo {
    color: #333;
    font-size: 22px;
    font-weight: bold;
    line-height: 60px;
    width: 200px;
}

.layui-header {
    background-color: #fff;
    box-shadow: 0 1px 4px rgba(0,0,0,0.1);
    position: fixed;
    width: 100%;
    z-index: 1000;
    height: 60px;
}

.post-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    margin-bottom: 10px;
}

#banner {
    height: 500px;
}

#banner img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.layui-card {
    margin-bottom: 15px;
}

.layui-card-header {
    font-size: 16px;
    font-weight: bold;
}

.layui-nav {
    background-color: transparent;
}

.layui-nav .layui-nav-item a {
    color: #333;
    font-size: 16px;
}

.layui-nav .layui-nav-item.layui-this a {
    color: #FF5722;
}

.layui-nav-child {
    background-color: #fff;
}

.layui-nav-child a {
    color: #333 !important;
}

.header-btn {
    background-color: #FF5722;
    border-radius: 20px;
    color: #fff !important;
    padding: 0 20px;
}

.banner-area {
    margin-top: 60px;
    padding: 20px 0;
    background-color: #fff;
}

.banner-item {
    position: relative;
    width: 100%;
    height: 100%;
}

.banner-content {
    position: relative;
    width: 100%;
    height: 100%;
}

.banner-content img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.banner-text {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 30px;
    background: linear-gradient(to top, rgba(0,0,0,0.7), transparent);
    color: #fff;
}

.banner-text h3 {
    font-size: 24px;
    margin-bottom: 10px;
}

.banner-text p {
    font-size: 16px;
    opacity: 0.9;
}

.main-container {
    padding: 30px 15px;
}

.section-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.section-title h2 {
    font-size: 24px;
    color: #333;
}

.more-link {
    color: #999;
    font-size: 14px;
}

.more-link:hover {
    color: #FF5722;
}

.post-card {
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    transition: all 0.3s ease;
}

.post-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.post-img {
    height: 200px;
    overflow: hidden;
    border-radius: 8px 8px 0 0;
}

.post-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: all 0.3s ease;
}

.post-card:hover .post-img img {
    transform: scale(1.1);
}

.post-content {
    padding: 20px;
}

.post-title {
    font-size: 18px;
    color: #333;
    margin-bottom: 10px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.post-summary {
    color: #666;
    font-size: 14px;
    line-height: 1.6;
    height: 44px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.post-meta {
    margin-top: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.post-author {
    display: flex;
    align-items: center;
}

.author-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    margin-right: 8px;
}

.post-stats {
    color: #999;
    font-size: 14px;
}

.post-stats span {
    margin-left: 15px;
}

.post-stats i {
    margin-right: 5px;
}

.footer {
    background-color: #fff;
    padding: 20px 0;
    text-align: center;
    color: #999;
    margin-top: 30px;
}

/* 导航栏样式 */
.layui-header {
    background-color: #fff;
    box-shadow: 0 1px 4px rgba(0,0,0,0.1);
    position: fixed;
    width: 100%;
    z-index: 1000;
    height: 60px;
}

.header-wrap {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100%;
}

.logo-wrap {
    flex: 0 0 200px;
}

.layui-logo {
    color: #FF5722;
    font-size: 24px;
    font-weight: bold;
    text-decoration: none;
    display: block;
    line-height: 60px;
    text-align: left;
}

.main-nav {
    flex: 1;
    display: flex;
    justify-content: center;
    background: none;
    padding: 0;
}

.user-nav {
    flex: 0 0 auto;
    background: none;
    padding: 0;
}

.layui-nav .layui-nav-item {
    line-height: 60px;
}

.layui-nav .layui-nav-item a {
    color: #333;
    font-size: 16px;
    padding: 0 20px;
}

.layui-nav .layui-nav-item.layui-this a {
    color: #FF5722;
}

.layui-nav .layui-nav-item a:hover {
    color: #FF5722;
}

.layui-nav .layui-this:after {
    background-color: #FF5722;
}

.header-btn {
    display: inline-block;
    height: 32px;
    line-height: 32px;
    padding: 0 18px;
    border-radius: 16px;
    font-size: 14px;
    margin-left: 10px;
}

.login-btn {
    background-color: transparent;
    border: 1px solid #FF5722;
    color: #FF5722 !important;
}

.login-btn:hover {
    background-color: rgba(255,87,34,0.1);
}

.register-btn {
    background-color: #FF5722;
    color: #fff !important;
}

.register-btn:hover {
    opacity: 0.9;
}

.user-info {
    margin-left: 20px;
}

.user-info .layui-nav-img {
    width: 30px;
    height: 30px;
    margin-right: 5px;
}

.layui-nav .layui-nav-child {
    top: 55px;
    border-radius: 4px;
    border: none;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.layui-nav .layui-nav-child a {
    color: #333;
    padding: 0 20px;
    line-height: 40px;
    font-size: 14px;
}

.layui-nav .layui-nav-child dd {
    line-height: 40px;
}

.layui-nav .layui-nav-child dd:hover {
    background-color: #f5f5f5;
}

.layui-nav .layui-nav-child i {
    margin-right: 5px;
    font-size: 14px;
}

/* 调整banner区域的上边距，以适应固定导航栏 */
.banner-area {
    margin-top: 60px;
    padding: 20px 0;
    background-color: #fff;
}

/* 修复导航栏箭头样式 */
.layui-nav .layui-nav-more {
    border-color: #666 transparent transparent;
}

.layui-nav .layui-nav-mored {
    border-color: transparent transparent #666;
}

/* 分类卡片样式 */
.category-card {
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.category-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.15);
}

.category-icon {
    width: 60px;
    height: 60px;
    margin: 0 auto 15px;
    background: #fd7e14;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.category-icon i {
    font-size: 24px;
    color: #fff;
}

.category-title {
    font-size: 18px;
    margin-bottom: 10px;
    color: #333;
}

.category-desc {
    font-size: 14px;
    color: #666;
    margin-bottom: 15px;
}

.category-count {
    font-size: 12px;
    color: #999;
}

/* 餐厅卡片样式 */
.restaurant-card {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}

.restaurant-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.15);
}

.restaurant-img {
    height: 100%;
    min-height: 200px;
    overflow: hidden;
}

.restaurant-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.restaurant-rating {
    display: flex;
    align-items: center;
    margin: 10px 0;
}

.rating-score {
    font-size: 24px;
    font-weight: bold;
    color: #fd7e14;
    margin-right: 10px;
}

.rating-stars {
    color: #ffc107;
    margin-right: 10px;
}

.review-count {
    font-size: 14px;
    color: #666;
}

.restaurant-cuisine {
    display: inline-block;
    padding: 4px 12px;
    background: #f8f9fa;
    border-radius: 20px;
    font-size: 14px;
    color: #666;
    margin: 10px 0;
}

.restaurant-address {
    font-size: 14px;
    color: #666;
    margin-bottom: 0;
}

/* 美食日记布局 */
.masonry-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr); /* 默认5列 */
    gap: 16px;
    padding: 16px;
}

.masonry-item {
    break-inside: avoid;
}

.post-card {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    transition: all 0.2s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
    cursor: pointer;
}

.post-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.post-image {
    position: relative;
    padding-top: 133.33%; /* 3:4 比例 */
    overflow: hidden;
    background: #f5f5f5;
}

.post-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.post-card:hover .post-image img {
    transform: scale(1.05);
}

.post-info {
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.post-title {
    font-size: 14px;
    font-weight: 600;
    line-height: 1.4;
    color: #333;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    margin: 0;
}

.post-summary {
    font-size: 12px;
    color: #666;
    line-height: 1.5;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    margin: 0;
}

.post-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
    padding-top: 8px;
}

.author {
    display: flex;
    align-items: center;
    gap: 6px;
}

.avatar {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    object-fit: cover;
}

.author-name {
    font-size: 12px;
    color: #666;
    max-width: 80px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.interaction {
    display: flex;
    align-items: center;
    gap: 8px;
}

.interaction-item {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: #999;
}

.interaction-item i {
    font-size: 12px;
}

.likes i {
    color: #ff4d4f;
}

/* 加载更多按钮 */
.load-more-container {
    text-align: center;
    margin-top: 32px;
    margin-bottom: 48px;
}

#loadMore {
    padding: 8px 32px;
    font-size: 14px;
    color: #666;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 24px;
    cursor: pointer;
    transition: all 0.2s ease;
}

#loadMore:hover {
    color: #ff4d4f;
    border-color: #ff4d4f;
}

/* 响应式布局 */
@media (max-width: 1600px) {
    .masonry-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 1200px) {
    .masonry-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .masonry-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
        padding: 12px;
    }
}

@media (max-width: 480px) {
    .masonry-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
        padding: 8px;
    }
    
    .post-info {
        padding: 8px;
    }
}

/* 加载动画 */
.loading .fa-spinner {
    display: inline-block !important;
}

/* Banner轮播图样式 */
#mainCarousel {
    margin-bottom: 40px;
}

.carousel-inner {
    border-radius: 0;
}

.carousel-img-container {
    position: relative;
    height: 500px;
    overflow: hidden;
}

.carousel-img-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.carousel-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.7), transparent);
    padding: 40px 20px 20px;
    text-align: left;
}

.carousel-caption h3 {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 10px;
    color: #fff;
}

.carousel-caption p {
    font-size: 16px;
    color: rgba(255,255,255,0.9);
    margin-bottom: 0;
}

.carousel-control-prev,
.carousel-control-next {
    width: 50px;
    height: 50px;
    background: rgba(0,0,0,0.3);
    border-radius: 50%;
    top: 50%;
    transform: translateY(-50%);
    margin: 0 20px;
}

.carousel-control-prev:hover,
.carousel-control-next:hover {
    background: rgba(0,0,0,0.5);
}

.carousel-indicators {
    margin-bottom: 20px;
}

.carousel-indicators button {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin: 0 5px;
    background-color: rgba(255,255,255,0.5);
}

.carousel-indicators button.active {
    background-color: #fff;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .carousel-img-container {
        height: 300px;
    }

    .carousel-caption h3 {
        font-size: 20px;
    }

    .carousel-caption p {
        font-size: 14px;
    }
} 